#pragma once
#include <memory.h>

struct bmp_image_info
{
	unsigned int dwWidth;
	unsigned int dwHeight;
	unsigned int dwColorNum;
	unsigned int dwByteNum;
	unsigned int dwPitch;
	unsigned int dwDecompression;
	unsigned int dwOrgDataSize;
	unsigned int dwColorBits;
	unsigned char * pPalette;
};
#pragma pack(push,packing)
#pragma pack(1)
typedef struct _BMPHeader
{
	unsigned short dwId;
	unsigned long dwFileSize;
	unsigned long dwReserved;
	unsigned long dwBitmapDataOffset;
	unsigned long dwBitmapHeaderSize;
	unsigned long dwWidth;
	unsigned long dwHeight;
	unsigned short dwPlanes;
	unsigned short dwBPP;
	unsigned long dwCompression;
	unsigned long dwBitmapDataSize;
	unsigned long dwPixelPerMeterX;
	unsigned long dwPixelPerMeterY;
	unsigned long dwColors;
	unsigned long dwImportantColors;
}BMPHeader;
#pragma pack(pop,packing)

void read_bmp_data(void * pDst,unsigned int size);
void set_bmp_data(unsigned char * pData);
void read_bmp_header( _BMPHeader * pHeader);
void read_bmp_image(unsigned char ** pOut, bmp_image_info * pInfo);